Skip to content

[foreignexchange] Code generation: update services and models - #2072

Open
AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/foreignexchange
Open

AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/foreignexchange

Conversation

@AdyenAutomationBot

@AdyenAutomationBot AdyenAutomationBot commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the foreignexchange service.

Adyen/adyen-openapi@63d4425

The commit history of this PR reflects the adyen-openapi commits that have been applied.

@AdyenAutomationBot
AdyenAutomationBot requested a review from a team as a code owner September 23, 2026 15:26

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the generated Java SDK models and service classes for the Foreign Exchange API, including rate calculation requests, responses, and error entities. The review feedback highlights a logic bug in JSON.java where the discriminator resolution incorrectly re-evaluates the parent's discriminator instead of the child's, as well as a missing @OverRide annotation on the equals method in AbstractOpenApiSchema.java.

Comment on lines +144 to +156
if (!discriminatorName.equals(childCdm.discriminatorName)) {
discrValue = getDiscriminatorValue(node);
if (discrValue == null) {
continue;
}
}
if (childCdm != null) {
// Recursively traverse the discriminator mappings.
Class<?> childDiscr = childCdm.getClassForElement(node, visitedClasses);
if (childDiscr != null) {
return childDiscr;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There is a logic bug in the discriminator resolution when the child schema has a different discriminator name. Calling getDiscriminatorValue(node) without a qualifier invokes the method on this (the parent), which re-evaluates the parent's discriminator instead of the child's. It should be childCdm.getDiscriminatorValue(node). Additionally, the null check if (childCdm != null) is redundant because childCdm == null is already checked and handled above.

        if (!discriminatorName.equals(childCdm.discriminatorName)) {
          discrValue = childCdm.getDiscriminatorValue(node);
          if (discrValue == null) {
            continue;
          }
        }
        // Recursively traverse the discriminator mappings.
        Class<?> childDiscr = childCdm.getClassForElement(node, visitedClasses);
        if (childDiscr != null) {
          return childDiscr;
        }

return o.toString().replace("\n", "\n ");
}

public boolean equals(Object o) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The equals method overrides Object.equals(Object) but is missing the @Override annotation. Adding @Override is a best practice to ensure compile-time safety and clarity.

  @Override
  public boolean equals(Object o) {

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 4 times, most recently from 9c40ee6 to cb486ea Compare October 1, 2026 14:41
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 2 times, most recently from 9e4535c to 79a3b11 Compare October 8, 2026 14:22
@andrej-gajduk-adyen
andrej-gajduk-adyen removed their request for review October 9, 2026 13:29
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 5 times, most recently from 277ce3c to ae2c405 Compare October 16, 2026 11:19
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch from ae2c405 to 0d9633b Compare October 16, 2026 13:40
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants